import java.sql.SQLOutput;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-30
 * Time:19:20
 */
public class Text2 {
    public static void merge(int A[], int m, int B[], int n) {
            int[] C = new int[n + m];
            int ee = 0;
            for (int t : B) {
                C[ee] = t;
                ee++;
            }
            for (int t : A) {
                if (t == 0)
                    break;
                C[ee] = t;
                ee++;
            }
            for (int i = 0; i < n + m - 1; i++) {
                for (int k = 0; k < n + m - 1 - i; k++) {
                    if (C[k] > C[k + 1]) {
                        C[k] = C[k + 1] ^ C[k];
                        C[k + 1] = C[k + 1] ^ C[k];
                        C[k] = C[k + 1] ^ C[k];

                    }
                }
            }
            for (int i = 0; i < n + m ; i++) {
                A[i] = C[i];
            }

        }



    public static void main(String[] args) {
        int[] A={1,2,3,0,0,0};
        int[] B={4,5,6};
        merge(A,3,B,3);
    }
}
